package com.ap.generator.common;

import com.ap.core.cxf.jaxb.common.AbstractDeliveryInfoTypeGeneratorBuilder;
import com.ap.core.cxf.jaxb.common.DeliveryType;

import static com.ap.datagen.core.GeneratorHelper.buildA;
import static com.ap.datagen.core.GeneratorHelper.fixedValueGenerator;
import static com.ap.datagen.core.Nullable.nullable;
import static com.ap.generator.common.DeliveryAddressGeneratorBuilder.getDeliveryAddressGenerator;

public class DeliveryInfoTypeGeneratorBuilder extends
AbstractDeliveryInfoTypeGeneratorBuilder {

	@Override
	public void setupDefaults() {
		// TODO Auto-generated method stub
		this.deliveryAddressGenerator = nullable(buildA(getDeliveryAddressGenerator()));
		this.deliveryTypeGenerator = FieldGenerator.DELIVERYTYPEGENERATOR;
		this.emailAddressGenerator = FieldGenerator.EMAILADDRESSGENERATOR;
	}

	public static DeliveryInfoTypeGeneratorBuilder getDeliveryInfoTypeGenerator() {
		return new DeliveryInfoTypeGeneratorBuilder();
	}
	
	public DeliveryInfoTypeGeneratorBuilder withDeliveryType(DeliveryType value) {
        this.deliveryTypeGenerator = nullable(fixedValueGenerator(value));
        return this;
    }
	
	public DeliveryInfoTypeGeneratorBuilder withDeliveryAddress() {
		 this.deliveryAddressGenerator = nullable(buildA(getDeliveryAddressGenerator()));		 
		 return this;
	}
	
}
